
import {Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn} from 'typeorm';
import {BaseEntity} from "../../../../common/entities/base";
import {UserEntity} from "../../../system/user/entities/sys-user.entity";

@Entity('edu_teacher', {
  comment: '教师表',
})
export class TeacherEntity extends  BaseEntity{
  @PrimaryGeneratedColumn({ type: 'int', name: 'id', comment: '主键ID' })
  public id: number;

  @Column({ type: 'varchar', name: 'teacher_name', default: '', comment: '教师名称' })
  public teacherName: string;

  @Column({ type: 'varchar', name: 'id_card', default: '', comment: '身份证号码' })
  public idCard: string;

  @Column({ type: 'varchar', name: 'teacher_number', default: '', comment: '教师编号' })
  public teacherNumber: string;

  @Column({ type: 'varchar', name: 'phone', default: '', comment: '性别' })
  public sex: string;

  @Column({ type: 'varchar', name: 'state', default: '', comment: '老师状态' })
  public state: string;

  @Column({ type: 'varchar', name: 'birthday', default: '', comment: '出生日期' })
  public birthday: string;

  @Column({ type: 'varchar', name: 'card_address', default: '', comment: '户籍地址' })
  public cardAddress: string;

  @Column({ type: 'varchar', name: 'house_address', default: '', comment: '家庭地址' })
  public houseAddress: string;

  @Column({ type: 'text', name: 'emergency', default: null, comment: '紧急联系' })
  public emergency: string;

  @Column({ type: 'int', name: 'teacher_id', default: null, comment: '教师Id，关联用户表' })
  public teacherId: number;

  @Column({ type: 'int', name: 'school_id', default: null, comment: '归属学校' })
  public schoolId: number;

  @Column({ type: 'varchar', name: 'teacher_level', default: '', comment: '教师职称' })
  public teacherLevel: string;

  @Column({ type: 'varchar', name: 'degree', default: '', comment: '最高学历' })
  public degree: string;

  @Column({ type: 'varchar', name: 'experience', default: '', comment: '教育经历' })
  public experience: string;

  @ManyToOne(() => UserEntity, user => user.userId)
  @JoinColumn({ name: 'teacher_id' })
  public user: UserEntity;
}
